package com.gxa.meiye.admin.platform.service.impl;

import com.gxa.meiye.admin.platform.mapper.CouponmanageMapper;
import com.gxa.meiye.admin.platform.pojo.vo.CouponManageVo;
import com.gxa.meiye.admin.platform.pojo.vo.DetailsCouponVo;
import com.gxa.meiye.admin.platform.pojo.vo.DetailsUserCouVo;
import com.gxa.meiye.admin.platform.service.CouponManageServcie;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class CouponManageServciceImpl implements CouponManageServcie {
    @Resource
    private CouponmanageMapper couponmanageMapper;

    @Override
    public List<CouponManageVo> queryAll() {
        List<CouponManageVo> couponManageVos = this.couponmanageMapper.queryAll();
        return couponManageVos;
    }

    @Override
    public List<CouponManageVo> selectAll(String name_id) {
        List<CouponManageVo> couponManageVos = this.couponmanageMapper.selectAll(name_id);
        return couponManageVos;
    }

    @Override
    public void addCoupon(String coupon_id,String title, Integer type, Double money, String datatime, Integer total, Integer status, Integer user_max, Integer issuing_condition,Integer existing_quantity, String created_time) {
        this.couponmanageMapper.addCoupon(coupon_id,title,type,money,datatime,total,status,user_max,issuing_condition,existing_quantity,created_time);

    }

    @Override
    public void deleteCoupon(Integer id) {
        this.couponmanageMapper.deleteCoupon(id);
    }

    @Override
    public List<DetailsCouponVo> queryCoupon(Integer id) {
        List<DetailsCouponVo> detailsCouponVos = this.couponmanageMapper.queryCoupon(id);
        return detailsCouponVos;
    }

    @Override
    public List<DetailsUserCouVo> queryCouponde(Integer id) {
        List<DetailsUserCouVo> detailsUserCouVos = this.couponmanageMapper.queryCouponde(id);
        return detailsUserCouVos;
    }

    @Override
    public List<DetailsUserCouVo> selectCouponde(String tempall) {
        List<DetailsUserCouVo> detailsUserCouVos = this.couponmanageMapper.selectCouponde(tempall);
        return detailsUserCouVos;
    }
}
